package com.ace.user.api.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author weihl
 * @date 2019/10/12 14:36
 */
@Component
public class FeignInterceptor implements RequestInterceptor {

    @Value("${listener.appId}")
    private  String appId;

    @Value("${listener.appSecret}")
    private  String appSecret;

    public void apply(RequestTemplate requestTemplate){
        requestTemplate.header("appId", appId);
        requestTemplate.header("appSecret", appSecret);
    }
}
